In [1]:
xxxxxxxxxxIn [2]:
xxxxxxxxxxLoad the example mpg dataset¶
- mpg : Miles per gallon
In [3]:
xxxxxxxxxxIn [4]:
xxxxxxxxxxOutputs unchanged
1
1
# Observe data1
1
# Observe columnsa.) Types¶
In [5]:
xxxxxxxxxxOutputs unchanged
1
1
## b.) missing valuesIn [6]:
1
1
mpg.isnull().sum()mpg 0 cylinders 0 displacement 0 horsepower 6 weight 0 acceleration 0 model_year 0 origin 0 name 0 dtype: int64
text/plain
Visualization¶
In [7]:
3
1
height = 102
sizes = (40, 400)3
alpha = 0.5In [6]:
In [8]:
4
1
# Plot miles per gallon against horsepower with other semantics2
sns.relplot(x="horsepower", y="mpg", hue="origin", size="weight",3
sizes=(40, 400), alpha=.5, palette="muted",4
height=6, data=mpg)⇛⇚
4
1
# Plot miles per gallon against horsepower with other semantics2
sns.relplot(x="horsepower", y="mpg", hue="origin", size="weight",3
sizes=sizes, alpha=alpha, palette="muted",4
height=height, data=mpg)Outputs changed
In [ ]:
1
1